package modelType

import (
	"database/sql/driver"
)

type EnumYN bool

func (e EnumYN) Value() (driver.Value, error) {
	if e {
		return "y", nil
	} else {
		return "n", nil
	}
}

func (e *EnumYN) Scan(value any) error {
	if string(value.([]byte)) == "y" {
		*e = true
	} else {
		*e = false
	}
	return nil
}
